package bean;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

@SuppressWarnings("serial")
public class News implements Serializable {
    private String content;
    private String id;
    private String img;
    private String keynode;
    private String src;
    private String summary;
    private String tid;
    private long time;
    private String title;
    private int comments_num;
    private String media;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getKeynode() {
        return keynode;
    }

    public void setKeynode(String keynode) {
        this.keynode = keynode;
    }

    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = (summary != null && !summary.isEmpty()) ? ("『" + summary + "』") : "";
    }


    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String topicId) {
        this.tid = topicId;
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }

    public int getComments_num() {
        return comments_num;
    }

    public void setComments_num(int commentsNum) {
        this.comments_num = commentsNum;
    }

    public String getMedia() {
        return media;
    }

    public void setMedia(String media) {
        this.media = media;
    }

    public boolean ableWa() {
        return !(this.tid == null || this.tid.isEmpty());
    }
}
